hysop.fields.ghost_exchangers module

class hysop.fields.ghost_exchangers.CartesianDiscreteFieldGhostExchanger(name, topology, data, kind=None, directions=None, ghosts=None, ghost_op=None, ghost_mask=None, exchange_method=None, global_lboundaries_config=None, global_rboundaries_config=None)[source]

Bases: GhostExchanger

By default, we exchange all ghosts, including diagonals. This is done by setting ghost_mask to GhostMask.FULL.

Just Cartesian Communicator neighbours are considered here (there is no direct communication between diagonal processes).

X P X

^

P < P > P

v

X P X

Diagonal ghosts are exchanged by chaining exchanges on two or more axes.

If ghost_mask is set to GhostMask.CROSS, diagonal ghosts are set to NAN to ensure they are not used.

Boundary conditions are hidden in the topology parameter:
(PERIODIC/PERIODIC) => standard periodic ghost exchange on the domain boundary

standard periodic ghost accumulation

(XXX/YYY) => symmetric or antisymmetric ghost exchange

ghost accumulation is a noop

Here XXX and YYY are either HOMOGENEOUS_DIRICHLET or HOMOGENEOUS_NEUMANN.

exchange_ghosts(**kwds)[source]

Exchange ghosts on specified data.

class hysop.fields.ghost_exchangers.GhostExchanger(name, topology, data, exchange_method, ghost_op, ghost_mask)[source]

Bases: GhostExchangerI

Prepare a backend specific ghost exchange, possibly on multiple data.

class hysop.fields.ghost_exchangers.GhostExchangerI[source]

Bases: object

Abstract interface for a ghost exchanger.

abstract exchange_ghosts(**kwds)[source]
class hysop.fields.ghost_exchangers.LocalBoundaryExchanger[source]

Bases: object

Helper class to generate symmetric and antisymmetric local ghost exchangers.

This is used for non-periodic boundary conditions:

HOMOGENEOUS_DIRICHLET: antisymmetric ghost exchange HOMOGENEOUS_NEUMANN: symmetric ghost exchange

classmethod build_antisymmetric_exchanger(shape, direction, to_left)[source]
classmethod build_exchanger(shape, direction, H, to_left)[source]
classmethod build_scalar_exchanger(value, shape, direction, to_left=None)[source]
classmethod build_symmetric_exchanger(shape, direction, to_left)[source]
class hysop.fields.ghost_exchangers.MultiGhostExchanger(name)[source]

Bases: GhostExchangerI

Handle multiple ghost exchangers.

exchange_ghosts(**kwds)[source]

Exchange ghosts on specified data.

hysop.fields.ghost_exchangers.gprint(*args, **kwds)[source]
hysop.fields.ghost_exchangers.gprint_buffer(msg, buf, *args, **kwds)[source]